extends layout

block content
    div(class="ui  container")
      div(class="ui link cards")
        for item in articles
          div(class="ui card",data-id="#{item._id}")
            div(class="content")
              div(class="right floated meta")
                if(item.createTime)
                  | #{item.createTime}
                else
                  | 刚刚
              img(class="ui avatar image",src="/assets/images/avatar/tom.jpg")
              span #{item.author ? item.author : '博主'}
            div(class="image")
              if(!item.img)
                img(src="/assets/images/wireframe/square-image.png",alt="")
              else
                img(src="#{item.img}",alt="",style="max-height:290px;")
            div(class="content")
              a(class="header",href="/article/detail?id=#{item._id}") #{item.title.substr(0,10)+'...'}
              div(class="description") #{item.content.substr(0,80)+'...'}
            div(class="extra content")
              span(class="right floated")
                i(class="heart outline like icon")
                span #{item.likes ? item.likes : 0}
              i(class="comment icon")
              a(href="/article/detail?id=#{item._id}#comments") #{item.comments_num ? item.comments_num : 0}
